package top.hg.tool.modules.car.index;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: skh
 * @Date: 2019/7/30 10:48
 * @Description:
 */
@Repository
@Slf4j
public class IndexRepository {

    @Autowired
    private IndexDao indexDao;

    public List<IndexEntity> selectIndexByApplyNum(String applyNum) {
        EntityWrapper<IndexEntity> wrapper = new EntityWrapper<>();
        wrapper.eq("apply_num", applyNum);
        List<IndexEntity> indexEntityList = indexDao.selectList(wrapper);
        return indexEntityList;
    }

    public List<IndexEntity> selectIndexByName(String query) {
        EntityWrapper<IndexEntity> wrapper = new EntityWrapper<>();
        wrapper.eq("name", query);
        List<IndexEntity> indexEntityList = indexDao.selectList(wrapper);
        return indexEntityList;
    }
}
